home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / dlbox_2 / general.cpp < prev    next >
C/C++ Source or Header  |  1995-02-27  |  1KB  |  50 lines

  1. #include "inter.h"
  2. #include<stdio.h>
  3. #include<process.h>
  4. interface_class iface;
  5. void initg()
  6. {
  7.   int gdriver = DETECT, gmode, errorcode;
  8.   initgraph(&gdriver, &gmode, "");
  9. //  errorcode = graphresult();
  10.   settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
  11. }
  12. char deet[127];
  13.  
  14. test_box()
  15. {
  16.   iface.clear();
  17.   iface.addbox(123,28,394,265);
  18.   iface.addtitle("A General",131,12,BLUE,4,GOTHIC_FONT);
  19.   iface.addtitle("Example",147,50,BLUE,4,GOTHIC_FONT);
  20.   iface.addcheckbox("A Checkbox",40,100,3,UNCHECKED);
  21.   iface.addtitle("Some Lines",250,130,RED,4,SMALL_FONT);
  22.   iface.addtitle("And Boxes",250,160,LIGHTBLUE,4,SMALL_FONT);
  23.   iface.addfield("",30,150,10,6,TEXT);
  24.   iface.addtitle("A Text field",44,137,DARKGRAY,4,SMALL_FONT);
  25.   iface.addline(240,120,322,120,LIGHTGREEN);
  26.   iface.addline(231,134,267,154,LIGHTCYAN);
  27.   iface.addline(299,148,348,128,CYAN);
  28.   iface.addlbox(231,157,372,177,LIGHTRED);
  29.   iface.addlbox(309,161,367,174,YELLOW);
  30.   iface.addlbox(326,147,377,186,GREEN);
  31.   iface.addbutton("A Really long long button to press",30,181,14,289);
  32.   iface.addbutton("And a shorter one.",98,220,15,164);
  33.   iface.dodialog();
  34.  
  35.   closegraph();
  36.  
  37.   printf("Checkbox: %d\n",iface.get_checkbox_info(3));
  38.  
  39.   printf("Field: %s\n",iface.get_text_field_info(6));
  40.  
  41.   printf("Long button: %d\n",iface.get_button_info(14));
  42.   printf("Short button: %d\n",iface.get_button_info(15));
  43. }
  44.  
  45. main()
  46. {
  47.   initg();
  48.   test_box();
  49.   exit(0);
  50. }